/**
 * 
 */
package com.base.myproject.client.busi.b2c;

import com.base.myproject.client.system.Env;
import com.base.myproject.client.tools.SendServlet;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.google.gwt.core.client.GWT;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.Element;
import com.google.gwt.xml.client.Node;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;

/**
 * @author zgw
 *2009-7-26 下午08:15:03
 * javazgw@gmail.com
 */
public class B2cLogout extends com.base.myproject.client.system.Logout{
	public B2cLogout()
	{
		
	}
	public  boolean  logout() {
		SendServlet send = new SendServlet();
		String str = send.getStringx("/"+GWT.getModuleName()+"/BaseServlet",
				"Action=logout");
		Document doc = XMLParser.parse((String) str);
		NodeList list = doc.getElementsByTagName("root");
		Node node = list.item(0);
		Element elem = (Element) node;
		if (elem.getAttribute("status").equals(Env.LOGOUTSUCCESS)) {

			Env.setUid(null);

		
//				RootPanel.get("zgwtest").clear();
//				Login l = new Login();
//				
//				
//				RootPanel.get("zgwtest").add(l.createForm());
//		
//			MessageBox.alert("提示", "成功退出！", null);
			return true;

		} else {
			MessageBox.alert("提示", "有未知的错误！", null);
		}
		return false;
	}

}
